//
//  DefaultViewTableViewCell.m
//  FlyGift
//
//  Created by lanou3g on 15/7/13.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "DefaultViewTableViewCell.h"

@implementation DefaultViewTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.myImageView = [[UIImageView alloc]initWithFrame:CGRectMake(kP6width(5), kP6Height(4), kScreenWidth - kP6width(10), (kScreenWidth - kP6width(10)) / 2.18)];
        self.myImageView.backgroundColor = [UIColor grayColor];
        [self.myImageView.layer setCornerRadius:8];
        self.myImageView.layer.masksToBounds = YES;
        self.myImageView.userInteractionEnabled = YES;
        [self.contentView addSubview:_myImageView];
        
        UIView * labelView = [[UIView alloc]initWithFrame:CGRectMake(0, self.myImageView.frame.size.height - kP6Height(30), self.myImageView.frame.size.width, kP6Height(30))];
        labelView.backgroundColor = [UIColor blackColor];
        labelView.alpha = 0.2;
        [self.myImageView addSubview:labelView];
        
        self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(5, self.myImageView.frame.size.height - kP6Height(30), self.myImageView.frame.size.width, kP6Height(30))];
        self.titleLabel.textColor = [UIColor whiteColor];
        [self.myImageView addSubview:_titleLabel];
        
        self.likeView = [[UIView alloc]initWithFrame:CGRectMake(self.myImageView.frame.size.width - kP6width(85), kP6Height(10), kP6width(75), kP6Height(30))];
        self.likeView.backgroundColor = [UIColor blackColor];
        self.likeView.alpha = 0.3;
        self.likeView.layer.cornerRadius = self.likeView.frame.size.height / 2;
        self.likeView.layer.masksToBounds = YES;
        [self.myImageView addSubview:_likeView];
        
        self.likeButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.likeButton.frame = CGRectMake(self.likeView.frame.origin.x + kP6width(5), self.likeView.frame.origin.y + kP6Height(5), kP6Height(20), kP6Height(20));
        [self.likeButton setImage:[UIImage imageNamed:@"like_press@2x"] forState:UIControlStateNormal];
        [self.myImageView addSubview:_likeButton];
        
        self.likeLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.likeButton.frame.origin.x + self.likeButton.frame.size.width + kP6width(5),self.likeButton.frame.origin.y, kP6width(45), kP6Height(20))];
        self.likeLabel.textColor = [UIColor whiteColor];
        self.likeLabel.font = [UIFont systemFontOfSize:13];
        [self.myImageView addSubview:_likeLabel];
        
    }
    return self;
}








- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
